/*
 * Copyright 2008 the Breachwalls OSS project and the Others.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */
${template.generateJavaPackageSentence()}

<#list template.generateJavaImportClassSentences() as item>
${item}
<#if !item_has_next>

</#if>
</#list>
/**
 * ${model.getDescription()}のプロパティエディタ.
 * @author todoken
 * @version $Revision$
 */
public final class ${template.getGenerateEditorClassName()} extends ${template.addImportFullClassName("java.beans.PropertyEditorSupport")} {

    /**
     * ${model.getDescription()}の値を文字列表現として取得する.
     * @return ${model.getDescription()}の文字列表現
     */
    @Override
    public String getAsText() {
        ${model.getShortClassName()} v = (${model.getShortClassName()}) getValue();
        return v.value();
    }

    /**
     * 文字列表現の値を${model.getDescription()}として設定する.
     * @param text 文字列で表現した${model.getDescription()}の値
     */
    @Override
    public void setAsText(final String text) {
        ${model.getShortClassName()} v = ${model.getShortClassName()}.NULL;
        if (text != null && 0 < text.length()) {
            v = ${model.getShortClassName()}.valueOf(text);
        }
        setValue(v);
    }

}
